package org.example.aaaatest.xml;

import lombok.Data;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement(name = "route")
@XmlAccessorType(XmlAccessType.FIELD)
@Data
public class Route {


    @XmlAttribute(name = "SdkVer")
    private String SdkVer;

    @XmlAttribute(name = "Type")
    private String Type;

    @XmlAttribute(name = "Flag")
    private String Flag;

    @XmlAttribute(name = "Source")
    private String Source;

    @XmlAttribute(name = "Vers")
    private String Vers;

    @XmlAttribute(name = "Uuid")
    private String Uuid;

    @XmlAttribute(name = "ContentOptions")
    private String ContentOptions;

    @XmlAttribute(name = "DisFlag")
    private String DisFlag;

    @XmlElement(name = "location")
    private Location location;

    @XmlElement(name = "destination")
    private Destination destination;

    @XmlElement(name = "startpoint")
    private StartPoint startpoint;

    @XmlElement(name = "endpoint")
    private EndPoint endpoint;

    @XmlElement(name = "avoid")
    private Avoid avoid;

    // Getters and Setters
    // ...
    @XmlAccessorType(XmlAccessType.FIELD)
    @Data
    public static class Location {
        @XmlAttribute(name = "Type")
        private String Type;

        // Getters and Setters
        // ...
    }
    @XmlAccessorType(XmlAccessType.FIELD)
    @Data
    public static class Destination {
        @XmlAttribute(name = "Type")
        private String Type;

        @XmlElement(name = "Typecode")
        private String Typecode;

        @XmlElement(name = "NaviExtCode")
        private String NaviExtCode;

        // Getters and Setters
        // ...
    }
    @XmlAccessorType(XmlAccessType.FIELD)
    @Data
    public static class StartPoint {
        @XmlAttribute(name = "Type")
        private String Type;

        @XmlElement(name = "x")
        private double startX;

        @XmlElement(name = "y")
        private double startY;



    }

    @XmlAccessorType(XmlAccessType.FIELD)
    @Data
    public static class EndPoint {
        @XmlAttribute(name = "Type")  // 新增属性
        private String Type;

        @XmlElement(name = "x")
        private double endX;

        @XmlElement(name = "y")
        private double endY;


    }

    @XmlAccessorType(XmlAccessType.FIELD)
    @Data
    public static class Avoid {
        @XmlAttribute(name = "Type")
        private String Type;

        // Getters and Setters
        // ...
    }
}
